# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-filedepot
pkgname=('python2-filedepot' 'python-filedepot')
_pkgname=filedepot
pkgver=0.11.0
pkgrel=2
pkgdesc='Toolkit for storing files and attachments in web applications.'
arch=('any')
url='https://pypi.org/project/filedepot/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c210ac6debe729892fa5b9b5f63052dcba69cf056090923cbbf8428f7cc1823162becc8a55f0fcff4a55b037276f37dbe22c78513553d23a0c6337ead02fdeca')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python2 setup.py build
}

package_python2-filedepot() {
  depends=('python2' 'python2-unidecode')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-filedepot() {
  depends=('python' 'python-unidecode')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

